unit RelatorioCRChequePre;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, UFormRelatorio, DB, DBTables, StdCtrls, QRCtrls, QuickRpt,
  ExtCtrls;

type
  TFRelatorioChequePre = class(TFormRelatorio)
    QRLabel5: TQRLabel;
    QRLabel6: TQRLabel;
    QRLabel7: TQRLabel;
    QRLabel8: TQRLabel;
    QRLabel9: TQRLabel;
    QRLabel10: TQRLabel;
    QRLabel11: TQRLabel;
    QRLabel13: TQRLabel;
    QRLabel14: TQRLabel;
    QRLabel15: TQRLabel;
    QRLabel16: TQRLabel;
    QRGroup1: TQRGroup;
    QRExpr1: TQRExpr;
    QRBand2: TQRBand;
    QRDBText1: TQRDBText;
    QRDBText2: TQRDBText;
    QRDBText3: TQRDBText;
    QRDBText4: TQRDBText;
    QRDBText5: TQRDBText;
    QRDBText6: TQRDBText;
    QRDBText7: TQRDBText;
    QRDBText8: TQRDBText;
    QRDBText11: TQRDBText;
    QRBand3: TQRBand;
    QRLabel12: TQRLabel;
    QRExpr7: TQRExpr;
    QRLabel18: TQRLabel;
    QRExpr2: TQRExpr;
    QRLSituacao: TQRLabel;
    QRLabel20: TQRLabel;
    QRLDiasRestantes: TQRLabel;
    QRLabel21: TQRLabel;
    QRDBText9: TQRDBText;
    QRDBText10: TQRDBText;
    QRExpr3: TQRExpr;
    QRShape1: TQRShape;
    QRShape2: TQRShape;
    procedure FormCreate(Sender: TObject);
    procedure QRGroup1BeforePrint(Sender: TQRCustomBand;
      var PrintBand: Boolean);
    procedure QRLabel3Print(sender: TObject; var Value: String);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  FRelatorioChequePre: TFRelatorioChequePre;

implementation

uses UGeral, PesquisaCRChequePre;

{$R *.dfm}

procedure TFRelatorioChequePre.FormCreate(Sender: TObject);
begin
  inherited;
 QRelatorio.Close;
 QRelatorio.SQL.Clear;
 QRelatorio.SQL.Add('Select Emp_Razao as Razao from empresa ');
 QRelatorio.SQL.Add('Where Emp_Codigo = :Cod ');
 QRelatorio.ParamByName('Cod').AsInteger:=Codigoempresa;
 QRelatorio.Open;
 QRLNomeEmpresa.Caption:=QRelatorio.fieldByname('Razao').AsString;
end;

procedure TFRelatorioChequePre.QRGroup1BeforePrint(Sender: TQRCustomBand;
  var PrintBand: Boolean);
begin
  inherited;
  QRLDiasRestantes.Font.Color:=clBlue;
  if pos('-',DiasRelatorio(1,1,Date,FPesquisaCRChequePre.QPesquisa.FieldByName('VENCIMENTO').AsDateTime)) <> 0 then
    QRLDiasRestantes.Font.Color:=clRed;
  QRLDiasRestantes.Caption:=DiasRelatorio(1,1,Date,FPesquisaCRChequePre.QPesquisa.FieldByName('VENCIMENTO').AsDateTime) + ' para o Vencimento';
end;

procedure TFRelatorioChequePre.QRLabel3Print(sender: TObject;
  var Value: String);
begin
  inherited;
value:='';
end;

end.
